# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.contrib import admin
from website1.models import Movie, Classifies, Outsource
# Register your models here.


@admin.register(Movie)
class MovieModel(admin.ModelAdmin):
    list_display = ('moviename', 'weight', 'countnumber', 'avaliblesum', 'isoutsource', 'classify')
    fields = ('moviename', 'prefilename', 'suffixname', 'publishtime', 'types', 'area', 'language', 'actor', 'director', 'keyword', 'weight', 'countnumber', 'avaliblesum', 'introduce', 'duration', 'isoutsource', 'picurl', 'classify')
    search_fields = ('moviename', 'keyword', 'weight')
    list_editable = ('weight', 'avaliblesum')
    delete_confirmation_template = True

@admin.register(Classifies)
class ClassifiesModel(admin.ModelAdmin):
    list_display = ('classname', 'classkey', 'weight')
    fields = ('classname', 'classkey', 'weight')
    delete_confirmation_template = True


@admin.register(Outsource)
class OutsourceModel(admin.ModelAdmin):
    list_display = ('movie', 'num', 'outfilelink')
    fields = ('movie', 'outfilelink', 'num')
    list_editable = ('outfilelink', 'num')
    search_fields = ('movie__moviename', )
    delete_confirmation_template = True